#include<iostream>
#include<cstring>
#include<algorithm>
#include<cstdio>
using namespace std;
int n, m;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		if (n == 1) {
			cout << 2 << endl;
		}
		else if (n == 2) {
			cout << 14 << endl;
		}
		else {
			cout << 1;
			for (int i = 0; i < n - 2; i++) {
				cout << 0;
			}
			cout << 1 << endl;
		}
	}
	return 0;
}